home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / wtek0693.zip / OOPALLEY.ZIP / INTEGER.H < prev    next >
C/C++ Source or Header  |  1993-04-27  |  1KB  |  33 lines

  1. #ifndef INTEGER_H
  2. #define INTEGER_H
  3.  
  4. #include "object.h"
  5.  
  6. extern const Class class_Integer;
  7.  
  8. ////////////////////////////////////////////////////////////
  9. // class Integer (declaration)
  10. ////////////////////////////////////////////////////////////
  11. class Integer: public Object {
  12.     int val;
  13.                 // private member function
  14.     void        parseInteger(istream& strm)         { strm >> val; }
  15. public:
  16.                 // constructors, destructors
  17.                 Integer(int v =0)                   { val = v; }
  18.                 Integer(istream&);
  19.  
  20.     int                     value() const           { return val; }
  21.     int                     value(int newval)       { return val = newval; }
  22.     virtual int             compare(const Object&) const;
  23.     virtual Object*         copy() const;
  24.     virtual void            deepenShallowCopy();
  25.     virtual unsigned        hash()  const;
  26.     virtual const Class*    isA() const;
  27.     virtual bool            isEqual(const Object&) const;
  28.     virtual void            printOn(ostream& strm) const;
  29.     virtual const Class*    species() const;
  30. };
  31.  
  32. #endif
  33.